<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>互惠网购买录入订单</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/static/plupload/upfiless.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/Theme1/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/Theme1/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>互惠网购买录入订单 </h5>
                        <div class="ibox-tools">
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="__URL__/order_info" onsubmit="return validation()" class="form-horizontal" id="form-admin-add" enctype="multipart/form-data">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">会员编号</label>
                                <div class="col-sm-3">
                
                  <input type="text" class="form-control" name="userid" id="userid"  value="<{$Think.session.nvip_nvip_member_User}>" readonly />
                  
                                </div>
                            </div>

                            <div class="form-group">
                                 <label class="col-sm-1 control-label">淘宝账号</label>
                                <div class="col-sm-3">
                                    <input type="text" name="taobao" id="taobao" class="form-control" value="<{$level.taobao}>"readonly/>
                                </div>

                            </div>
              

                            <div class="form-group">
                                <label class="col-sm-1 control-label">支付宝账号</label>
                                <div class="col-sm-3">
                                    <input type="text" name="zhifubao" id="zhifubao" class="form-control" value="<{$level.zhifubao}>" readonly/>
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">订单编号</label>
                                <div class="col-sm-3">
                                    <input type="text" name="order_id" id="order_id" class="form-control" >
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">订单金额</label>
                                <div class="col-sm-3">
                                    <input type="text" name="order_jine" id="order_jine" class="form-control" onblur="check_amount(this.value,<{$Think.session.nvip_nvip_member_User}>)">
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">订单时间</label>
                                <div class="col-sm-3">
                                    <script type="text/javascript"> 
                                                    function DateSelector(selYear, selMonth, selDay) { 
                                                    this.selYear = selYear; 
                                                    this.selMonth = selMonth; 
                                                    this.selDay = selDay; 
                                                    this.selYear.Group = this; 
                                                    this.selMonth.Group = this; 
                                                    // 给年份、月份下拉菜单添加处理onchange事件的函数 
                                                    if (window.document.all != null) // IE 
                                                    { 
                                                    this.selYear.attachEvent("onchange", DateSelector.Onchange); 
                                                    this.selMonth.attachEvent("onchange", DateSelector.Onchange); 
                                                    } 
                                                    else // Firefox 
                                                    { 
                                                    this.selYear.addEventListener("change", DateSelector.Onchange, false); 
                                                    this.selMonth.addEventListener("change", DateSelector.Onchange, false); 
                                                    } 
                                                    if (arguments.length == 4) // 如果传入参数个数为4，最后一个参数必须为Date对象 
                                                    this.InitSelector(arguments[3].getFullYear(), arguments[3].getMonth() + 1, arguments[3].getDate()); 
                                                    else if (arguments.length == 6) // 如果传入参数个数为6，最后三个参数必须为初始的年月日数值 
                                                    this.InitSelector(arguments[3], arguments[4], arguments[5]); 
                                                    else // 默认使用当前日期 
                                                    { 
                                                    var dt = new Date(); 
                                                    this.InitSelector(dt.getFullYear(), dt.getMonth() + 1, dt.getDate()); 
                                                    } 
                                                    } 
                                                    // 增加一个最大年份的属性 
                                                    DateSelector.prototype.MinYear = 1900; 
                                                    // 增加一个最大年份的属性 
                                                    DateSelector.prototype.MaxYear = (new Date()).getFullYear(); 
                                                    // 初始化年份 
                                                    DateSelector.prototype.InitYearSelect = function () { 
                                                    // 循环添加OPION元素到年份select对象中 
                                                    for (var i = this.MaxYear; i >= this.MinYear; i--) { 
                                                    // 新建一个OPTION对象 
                                                    var op = window.document.createElement("OPTION"); 
                                                    // 设置OPTION对象的值 
                                                    op.value = i; 
                                                    // 设置OPTION对象的内容 
                                                    op.innerHTML = i; 
                                                    // 添加到年份select对象 
                                                    this.selYear.appendChild(op); 
                                                    } 
                                                    } 
                                                    // 初始化月份 
                                                    DateSelector.prototype.InitMonthSelect = function () { 
                                                    // 循环添加OPION元素到月份select对象中 
                                                    for (var i = 1; i < 13; i++) { 
                                                    // 新建一个OPTION对象 
                                                    var op = window.document.createElement("OPTION"); 
                                                    // 设置OPTION对象的值 
                                                    op.value = i; 
                                                    // 设置OPTION对象的内容 
                                                    op.innerHTML = i; 
                                                    // 添加到月份select对象 
                                                    this.selMonth.appendChild(op); 
                                                    } 
                                                    } 
                                                    // 根据年份与月份获取当月的天数 
                                                    DateSelector.DaysInMonth = function (year, month) { 
                                                    var date = new Date(year, month, 0); 
                                                    return date.getDate(); 
                                                    } 
                                                    // 初始化天数 
                                                    DateSelector.prototype.InitDaySelect = function () { 
                                                    // 使用parseInt函数获取当前的年份和月份 
                                                    var year = parseInt(this.selYear.value); 
                                                    var month = parseInt(this.selMonth.value); 
                                                    // 获取当月的天数 
                                                    var daysInMonth = DateSelector.DaysInMonth(year, month); 
                                                    // 清空原有的选项 
                                                    this.selDay.options.length = 0; 
                                                    // 循环添加OPION元素到天数select对象中 
                                                    for (var i = 1; i <= daysInMonth; i++) { 
                                                    // 新建一个OPTION对象 
                                                    var op = window.document.createElement("OPTION"); 
                                                    // 设置OPTION对象的值 
                                                    op.value = i; 
                                                    // 设置OPTION对象的内容 
                                                    op.innerHTML = i; 
                                                    // 添加到天数select对象 
                                                    this.selDay.appendChild(op); 
                                                    } 
                                                    } 
                                                    // 处理年份和月份onchange事件的方法，它获取事件来源对象（即selYear或selMonth） 
                                                    // 并调用它的Group对象（即DateSelector实例，请见构造函数）提供的InitDaySelect方法重新初始化天数 
                                                    // 参数e为event对象 
                                                    DateSelector.Onchange = function (e) { 
                                                    var selector = window.document.all != null ? e.srcElement : e.target; 
                                                    selector.Group.InitDaySelect(); 
                                                    } 
                                                    // 根据参数初始化下拉菜单选项 
                                                    DateSelector.prototype.InitSelector = function (year, month, day) { 
                                                    // 由于外部是可以调用这个方法，因此我们在这里也要将selYear和selMonth的选项清空掉 
                                                    // 另外因为InitDaySelect方法已经有清空天数下拉菜单，因此这里就不用重复工作了 
                                                    this.selYear.options.length = 0; 
                                                    this.selMonth.options.length = 0; 
                                                    // 初始化年、月 
                                                    this.InitYearSelect(); 
                                                    this.InitMonthSelect(); 
                                                    // 设置年、月初始值 
                                                    this.selYear.selectedIndex = this.MaxYear - year; 
                                                    this.selMonth.selectedIndex = month - 1; 
                                                    // 初始化天数 
                                                    this.InitDaySelect(); 
                                                    // 设置天数初始值 
                                                    this.selDay.selectedIndex = day - 1; 
                                                    } 
                                                    </script> 
                                                    </head> 
                                                    <body> 
                                                    <select id="selYear" name="order_nian"></select> 年
                                                    <select id="selMonth" name="order_yue"></select> 月
                                                    <select id="selDay" name="order_ri"></select>日
                                                    <select id="shi" name="order_shi">
                                                        <?php
                                                            for($i=1;$i<=24;$i++){
                                                        ?>

                                                        <option value ="<?php echo $i ?>"><?php echo $i ?></option>
                                                             <?Php

                                                            }
                                                         ?>
                                                    </select> 时
                                                    <select id="fen" name="order_fen">

                                                        <?php
                                                            for($i=1;$i<=60;$i++){
                                                        ?>

                                                        <option value ="<?php echo $i ?>"><?php echo $i ?></option>
                                                             <?Php

                                                            }
                                                         ?>

                                                    </select>分

                                                    <select id="miao" name="order_miao">
                                                          <?php
                                                            for($i=1;$i<=60;$i++){
                                                        ?>

                                                        <option value ="<?php echo $i ?>"><?php echo $i ?></option>
                                                             <?Php

                                                            }
                                                         ?>

                                                    </select>  秒
                                                    <script type="text/javascript"> 
                                                    var selYear = window.document.getElementById("selYear"); 
                                                    var selMonth = window.document.getElementById("selMonth"); 
                                                    var selDay = window.document.getElementById("selDay"); 
                                                    // 新建一个DateSelector类的实例，将三个select对象传进去 
                                                    //new DateSelector(selYear, selMonth, selDay, 2017, 3, 29); 
                                                    // 也可以试试下边的代码 
                                                     var dt = new Date();
                                                  
                                                     new DateSelector(selYear, selMonth ,selDay,dt ); 
                                                    </script> 
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">物品名称</label>
                                <div class="col-sm-3">
                                    <input type="text" name="order_wupin" id="order_wupin" class="form-control" >
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">店铺名称</label>
                                <div class="col-sm-3">
                                    <input type="text" name="order_dianpu" id="order_dianpu" class="form-control">
                                </div>

                            </div>

                            <div>

              
              
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                  <input type="hidden" value="up1" name="act" />
                                    <button class="btn btn-primary" type="submit">提交审核</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        

    <script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/iCheck/icheck.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/jquery.validate.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/messages_zh.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/validate-methods.js"></script> 
<script type="text/javascript" src="__PUBLIC__/Theme1/lib/webuploader/0.1.5/webuploader.min.js"></script> 


</body>

</html>
<script type="text/javascript">
    function check_amount(amount,username){
    if(isNaN(amount)){
        alert('请输入数字');
        $("#order_jine").val('');
        $("#order_jine").focus();

    }
   $.ajax({
             type: "POST",
             url: '__URL__/check_orderamount',
             data: {amount:amount,username:username},
             dataType: "json",
             success: function(data){
                        if(amount>data){
                             alert('您输入的金额大于可用额度'); 
                              $("#order_jine").val('');
                                $("#order_jine").focus();
                        }
                      }
         });
}

</script>

<script type="text/javascript" defer=true>
function validation(){
  
    if(document.getElementById('userid').value==''){
        alert('请输入用户名');
        return false;
    }
    
    if(document.getElementById('order_id').value==''){
        alert('请输入淘宝订单号');
        return false;
    }
    if(document.getElementById('order_jine').value==''){
        alert('请输入订单金额');
        return false;
    }
    if(document.getElementById('order_time').value==''){
        alert('请输入订单时间');
        return false;
    }
    if(document.getElementById('order_wupin').value==''){
        alert('请输入购买物品名称');
        return false;
    }
    if(document.getElementById('order_dianpu').value==''){
        alert('请输入物品所属店铺');
        return false;
    }
    

}    

</script>
